class MyController < ApplicationController
  
  before_filter :login_required, :only => [:edit_avatar, :update_avatar]
  
  def index
    subdomain = request.subdomains[0]
    @user = User.find_by_login(subdomain)
  end

  def edit_avatar
    render :layout => false
  end
  
  def update_avatar
    avatar_path = params[:avatar_path]
    user = User.find(current_user.id)
    user.update_avatar_path(avatar_path)
    render :text => "success"
  end
end
